package iss.java;

import iss.java.list.MyList;
import iss.java.list.Node;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
/**
 * Created by wenke on 2016/9/16.
 * NOTE: This is an example of how to iterate MyList.
 */
public class Main {
    public static void main(String[] args) {
        MyList list = new MyList();
        list.insert(list.getHead(), 5);
        list.insert(list.getHead(), 4);
        list.insert(list.getHead(), 3);
        list.insert(list.getHead(), 2);
        list.insert(list.getHead(), 1);
        list.forwardPrint();

        System.out.println("the ID of list is"+list.getID());

        Mylist list_1=new Mylist();
        System.out.println("the ID of list_1 is"+list_1.getID());
        list_1.insert(list.getHead(),30);
        list_1.remove(list.getHead().getNext());

        Mylist list_2=new Mylist();
        System.out.println("the ID of list_2 is"+list_2.getID());
        list_2.insert(list.getHead(),30);
        list_2.remove(list.getHead().getNext());

        list.forwardPrint();

    }
}
